Regex - matching the attribute value

Hi all. I'm trying to filter some rows based on the value of the attribute.

If the value of the attribute is of enumeration type I want to match the whole word and filter, and if it is not of enumeration type matching of the "whole word" is not required and filtering will be done even if it contains the mentioned word.

 

My issue - How do I traverse all the columns and match the whole word for the enumeration type attributes?

Thank you in advance. Any help will be appreciated. :)


cron7 - Fri Nov 03 00:55:29 EDT 2017

Re: Regex - matching the attribute value
Mike.Scharnow - Fri Nov 03 04:19:03 EDT 2017

I have trouble understanding your use case, how the input parameters of your function are and what the output shall be, perhaps you can give some examples.

What I imagine currently is: as an input you get a module and an attribute name plus a term to search for.

In this case, the first step would be to find the AttrType of the atribute in the module and to determine whether the attribute is of type enumeration or not. In either case you have two different comparisons. If the attribute is an enumeration, you can use the comparison "isMember". If not, you can use a regex or "findPlainText". In either case you walk through all objects and look at the desired attribute and do the comparison. If you really want to create a "filter", you will use "accept" and "reject" depending on the result of your search.